const path = require('path');

module.exports = {
  entry: "./src/index.js",
  mode: "development",
  output: {
    path: path.resolve(__dirname, "./dist"),
    filename: "bundle.js",
  },
  resolveLoader: { // 配置如何解析loader
    modules: ["./node_modules", "./lib/loaders"] // 去这些文件夹下找loader, loader 的名称就是loader的文件名, 可以不用写.js
  },
  module: {
    rules: [{
      test: /\.js$/,
      use: [{
        loader: path.resolve(__dirname, "./lib/loaders/replaceLoader.js?age=28"), // 打印this.query  ?age=28
        options: {
          name: "拉斯达"
        }
      }],
      
    }, {
      test: /\.less$/,
      use: ['style-loader', 'less-loader']
    }]
  },
  
};